changed #if to #ifdef and #ifndef