added deallocate parameter to push function