fixed error from log function