I have the same problem.
check this :
What happens if I am laid off? Change jobs? My H-1B visa expires? I move? Or I leave the U.S. before I obtain permanent resident status?
Your H-1B visa must be current and valid and you must be legally working in your eligible occupation at the time of...