popElement and sendElement function added