Code to print stack trace added