check deployment target before using deprecated calls, fixes #4