bug executing undefined function