Added defer logic

Added defer logic