fixing issue with passing inexistent object to the template