Added error handling for non existing variables