fixing check function
removed un-needed variable