stack throws exception if array is empty