[PATCH] PM: Change code ordering in main.c