fixed logging and unnessesary calls