added exception handling to availability IF