added update stack functionality