warning suppression

checking variables before they are used to suppress warnings