updated push, added traits for functions, added error handler