Add additional condition  and logging

Add additional condition to prevent EmptyStackException and add logging
for Storage class