implementing better error handling, logging out the position