fixed some function checks