Updated minidc logic

Added error handling for "pop from empty stack" error.